package com.zkh.myutils.io.excel.worksheet.style;

import java.util.Objects;

/**
 * 对齐方式
 * @author zkh
 */
public class Alignment {
	//垂直对齐
	private Align vertical;
	//水平对齐
	private Align horizontal;
	
	/**
	 * 无参构造
	 */
	public Alignment() {}
	/**
	 * 构造方法
	 * @param horizontal 水平对齐方式
	 * @param vertical 垂直对齐方式
	 */
	public Alignment(Align horizontal, Align vertical) {
		this.vertical = vertical;
		this.horizontal = horizontal;
	}
	/**
	 * 设置垂直对齐方式
	 * @param vertical
	 */
	public void setVertical(Align vertical) {
		this.vertical = vertical;
	}
	/**
	 * 设置水平对齐方式
	 * @param horizontal
	 */
	public void setHorizontal(Align horizontal) {
		this.horizontal = horizontal;
	}
	/**
	 * 获取水平对齐方式
	 * @return
	 */
	public Align getHorizontal() {
		return horizontal;
	}
	/**
	 * 获取垂直对齐方式
	 * @return
	 */
	public Align getVertical() {
		return vertical;
	}
	@Override
	public int hashCode() {
		return Objects.hash(horizontal, vertical);
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Alignment other = (Alignment) obj;
		return horizontal == other.horizontal && vertical == other.vertical;
	}
}
